package com.aigc.sclassroom.mapper;

import com.aigc.sclassroom.pojo.Feedback;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface FeedbackMapper {
    @Select("select f.feedback_id,u.user_name,f.opnion,f.satisfaction,f.speed,f.interaction,f.environment,f.understand\n" +
            "from feedback f\n" +
            "left join sys_user u on f.user_id=u.user_id\n" +
            "where f.survey_id=#{surveyId}")
    List<Feedback> selectAll(Long surveyId);

    @Insert("insert into feedback(user_id, survey_id, opnion, satisfaction, speed, interaction, environment, understand)" +
            "values (#{userId},#{surveyId},#{opnion},#{satisfaction},#{speed},#{interaction},#{environment},#{understand})")
    void add(Feedback feedback);
}
